<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="hexo搭建记录, Lemonade&#39;s Blog">
    <meta name="description" content="# 新建博客文章
hexo new &#34;New&#34;

# 部署本地
hexo s

# 部署到腾讯云静态网站托管
hexo g
cd public # 切记，先切到这个目录下
tcb hosting deploy -e blogger-000-">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="referrer" content="no-referrer-when-downgrade">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    <title>hexo搭建记录 | Lemonade&#39;s Blog</title>
    <link rel="icon" type="image/png" href="https://notes2021.oss-cn-beijing.aliyuncs.com/2021/IMG_0551.JPG">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/all.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">

    <script src="/libs/jquery/jquery-3.6.0.min.js"></script>

<meta name="generator" content="Hexo 6.0.0"><link rel="stylesheet" href="/css/prism-tomorrow.css" type="text/css"></head>




<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/" class="waves-effect waves-light">
                    
                    <span class="logo-span">Lemonade&#39;s Blog</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>


<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <div class="logo-name">Lemonade&#39;s Blog</div>
        <div class="logo-desc">
            
            Never really desperate, only the lost of the soul.
            
        </div>
    </div>

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://github.com/blinkfox/hexo-theme-matery" class="waves-effect waves-light" target="_blank">
                <i class="fab fa-github-square fa-fw"></i>Fork Me
            </a>
        </li>
        
    </ul>
</div>


        </div>

        
            <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="https://github.com/blinkfox/hexo-theme-matery" class="github-corner tooltipped hide-on-med-and-down" target="_blank"
   data-tooltip="Fork Me" data-position="left" data-delay="50">
    <svg viewBox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor" class="octo-body"></path>
    </svg>
</a>
        
    </nav>

</header>

    



<div class="bg-cover pd-header post-cover" style="background-image: url('/medias/featureimages/6.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">hexo搭建记录</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        padding: 35px 0 15px 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        padding-bottom: 30px;
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;

        position: absolute;
        right: 23.5vw;
        display: block;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/tags/hexo/">
                                <span class="chip bg-color">hexo</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/categories/5-%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/" class="post-category">
                                5.环境配置
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2021-12-31
                </div>
                

                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-check fa-fw"></i>更新日期:&nbsp;&nbsp;
                    2022-01-20
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>文章字数:&nbsp;&nbsp;
                    2.9k
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-clock fa-fw"></i>阅读时长:&nbsp;&nbsp;
                    12 分
                </div>
                

                
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="far fa-eye fa-fw"></i>阅读次数:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>
        </div>
        <hr class="clearfix">

        

        

        <div class="card-content article-card-content">
            <div id="articleContent">
                <pre class=" language-bash"><code class="language-bash"><span class="token comment" spellcheck="true"># 新建博客文章</span>
hexo new <span class="token string">"New"</span>

<span class="token comment" spellcheck="true"># 部署本地</span>
hexo s

<span class="token comment" spellcheck="true"># 部署到腾讯云静态网站托管</span>
hexo g
<span class="token function">cd</span> public <span class="token comment" spellcheck="true"># 切记，先切到这个目录下</span>
tcb hosting deploy -e blogger-000-123456（这里是你自己的环境id）
</code></pre>
<h1 id="写在前面"><a href="#写在前面" class="headerlink" title="写在前面"></a>写在前面</h1><pre class=" language-bash"><code class="language-bash"><span class="token comment" spellcheck="true"># 参考</span>
搭建参考
http://fuchenchenle.cn/
https://www.bilibili.com/video/BV1cp4y1i7C7?p<span class="token operator">=</span>2
https://cloud.tencent.com/developer/article/1671013 <span class="token comment" spellcheck="true">#腾讯云官方：如何将 Hexo 博客部署到云开发静态网站托管</span>

主题美化参考
https://blog.csdn.net/cungudafa/category_9714183.html
https://cungudafa.blog.csdn.net/article/details/104295156
https://blog.csdn.net/victoryxa/article/details/105841440?spm<span class="token operator">=</span>1001.2014.3001.5501

hexo官网
https://hexo.io/zh-cn/docs/

错误解决
https://www.94ip.com/post/799.html（Linux下报错E212: Can’t <span class="token function">open</span> <span class="token function">file</span> <span class="token keyword">for</span> writing解决方法）
部署Hexo到腾讯云静态托管后主页主题不生效：时间问题，刷新一会就好。

友情链接
https://www.iamys.club/
</code></pre>
<h1 id="博客搭建过程"><a href="#博客搭建过程" class="headerlink" title="博客搭建过程"></a>博客搭建过程</h1><h2 id="1-前提"><a href="#1-前提" class="headerlink" title="1.前提"></a>1.前提</h2><blockquote>
<p>安装<code>node.js </code> 和 <code>git</code></p>
</blockquote>
<pre class=" language-bash"><code class="language-bash">brew <span class="token function">install</span> node
</code></pre>
<pre class=" language-bash"><code class="language-bash"><span class="token comment" spellcheck="true"># 验证已安装</span>
<span class="token punctuation">(</span>base<span class="token punctuation">)</span> cat@zhangjianlindeMacBook-Pro ~ % node -v
v16.10.0
<span class="token punctuation">(</span>base<span class="token punctuation">)</span> cat@zhangjianlindeMacBook-Pro ~ % <span class="token function">npm</span> -v
7.24.0

<span class="token punctuation">(</span>base<span class="token punctuation">)</span> cat@zhangjianlindeMacBook-Pro ~ % <span class="token function">git</span> --version
<span class="token function">git</span> version 2.30.1 <span class="token punctuation">(</span>Apple Git-130<span class="token punctuation">)</span>
<span class="token punctuation">(</span>base<span class="token punctuation">)</span> cat@zhangjianlindeMacBook-Pro ~ % <span class="token function">which</span> <span class="token function">git</span>
/usr/bin/git
<span class="token comment" spellcheck="true"># 验证node环境配置</span>
https://www.cnblogs.com/richerdyoung/p/7265786.html
</code></pre>
<blockquote>
<p>mac终端美化（强烈推荐！！！）</p>
</blockquote>
<pre class=" language-bash"><code class="language-bash">https://www.bilibili.com/video/BV1nf4y1r79A/?spm_id_from<span class="token operator">=</span>333.788.recommend_more_video.1
https://www.mintimate.cn/2021/02/05/configZsh/
</code></pre>
<h2 id="2-创建hexo目录"><a href="#2-创建hexo目录" class="headerlink" title="2.创建hexo目录"></a>2.创建hexo目录</h2><p>创建一个Hexo博客的文件夹（以后对Hexo的操作，均在文件夹内完成），并使用<code>cd</code>命令进入。如：</p>
<pre class=" language-bash"><code class="language-bash">mintimate@MintimateMacBook-Pro ~ % <span class="token function">mkdir</span> hexo <span class="token comment" spellcheck="true">#我创建一个叫hexo的空文件夹</span>
mintimate@MintimateMacBook-Pro ~ % <span class="token function">cd</span> hexo <span class="token comment" spellcheck="true">#切换Terminal到刚刚创建的文件夹内</span>
</code></pre>
<h2 id="3-部署hexo本地服务"><a href="#3-部署hexo本地服务" class="headerlink" title="3.部署hexo本地服务"></a>3.部署hexo本地服务</h2><h3 id="使用npm安装Hexo"><a href="#使用npm安装Hexo" class="headerlink" title="使用npm安装Hexo"></a>使用npm安装Hexo</h3><p>因为Node里自带npm，所以我们可以直接使用npm。</p>
<pre class=" language-bash"><code class="language-bash"><span class="token function">npm</span> config <span class="token keyword">set</span> registry http://mirrors.cloud.tencent.com/npm/<span class="token punctuation">(</span>可选，更换npm为腾讯云源<span class="token punctuation">)</span>
<span class="token function">npm</span> <span class="token function">install</span> -g hexo
<span class="token function">npm</span> <span class="token function">install</span> -g hexo-cli
</code></pre>
<p>安装好以后，测试一下：</p>
<pre class=" language-bash"><code class="language-bash">hexo
</code></pre>
<p>没有出现未知命令，说明安装成功。可以接下来操作了。</p>
<h3 id="初始化Hexo"><a href="#初始化Hexo" class="headerlink" title="初始化Hexo"></a>初始化Hexo</h3><p>切换到Hexo目录，后续操作均在Hexo目录内进行。</p>
<pre class=" language-bash"><code class="language-bash">hexo init
</code></pre>
<h3 id="启动Hexo内建服务器"><a href="#启动Hexo内建服务器" class="headerlink" title="启动Hexo内建服务器"></a>启动Hexo内建服务器</h3><p>其实，整个<code>public</code>文件就是一个博客了，但是我们还要部署<code>Nginx</code>等网络环境或者使用<code>HBuilderX</code>等根据，启动Web服务器才能用浏览器本地IP(即：<code>127.0.0.1</code>或<code>localhost</code>)加端口进行访问；为了减少麻烦，可以使用Hexo内建服务器：</p>
<pre class=" language-bash"><code class="language-bash">hexo s
</code></pre>
<p>如果出现未知命令，先执行：</p>
<pre class=" language-bash"><code class="language-bash"><span class="token function">npm</span> <span class="token function">install</span> hexo-server --save
</code></pre>
<p>执行完成后，再执行<code>hexo s</code>即可。</p>
<img src="https://notes2021.oss-cn-beijing.aliyuncs.com/2021/image-20211230004124430.png" alt="image-20211230004124430" style="zoom: 33%;" />

<pre class=" language-bash"><code class="language-bash"><span class="token function">cat</span> at zhangjianlindeMacBook-Pro <span class="token keyword">in</span> ~/IdeaProjects/blog 
$ hexo s
INFO  Validating config
INFO  Start processing
INFO  Hexo is running at http://localhost:4000 <span class="token keyword">.</span> Press Ctrl+C to stop.
</code></pre>
<p>这个时候。浏览器访问：<code>127.0.0.1:4000</code>或<code>localhost:4000</code>即可访问博客。</p>
<p><img src="https://notes2021.oss-cn-beijing.aliyuncs.com/2021/image-20211230003958902-20211231220501180.png" alt="image-20211230003958902"></p>
<h3 id="构建Hexo"><a href="#构建Hexo" class="headerlink" title="构建Hexo"></a>构建Hexo</h3><p>初始化Hexo后，其实Hexo就可以使用了。构建Hexo会在当前目录下生成一个叫<code>public</code>的文件夹，这个文件夹就是根据你Hexo的配置，生成的<code>HTML+CSS+JS</code>的静态文件。</p>
<pre class=" language-bash"><code class="language-bash">hexo g
</code></pre>
<h2 id="4-部署hexo到远程平台"><a href="#4-部署hexo到远程平台" class="headerlink" title="4.部署hexo到远程平台"></a>4.部署hexo到远程平台</h2><p>上诉操作，我们已经把Hexo部署在本地；接下来，我们来看看怎么部署到远程平台，部署到远程平台后，公网用户就可以访问了（也就是可以让你小伙伴通过浏览器访问到你的博客）。</p>
<h3 id="部署到Github（完成中）"><a href="#部署到Github（完成中）" class="headerlink" title="部署到Github（完成中）"></a>部署到Github（完成中）</h3><h3 id="部署到码云Gitee（已完成）https-lemonade19-gitee-io"><a href="#部署到码云Gitee（已完成）https-lemonade19-gitee-io" class="headerlink" title="部署到码云Gitee（已完成）https://lemonade19.gitee.io/"></a>部署到码云Gitee（已完成）<a target="_blank" rel="noopener" href="https://lemonade19.gitee.io/">https://lemonade19.gitee.io/</a></h3><h4 id="新建仓库"><a href="#新建仓库" class="headerlink" title="新建仓库"></a>新建仓库</h4><img src="https://notes2021.oss-cn-beijing.aliyuncs.com/2021/image-20220114232054735.png" alt="" style="zoom: 33%;" />

<blockquote>
<p>注意：仓库名称必须要和用户名一样，否则最后部署出来会出现无样式的效果或者其他不正常的显示。</p>
</blockquote>
<h4 id="添加公钥（生成-添加SSH公钥）"><a href="#添加公钥（生成-添加SSH公钥）" class="headerlink" title="添加公钥（生成/添加SSH公钥）"></a>添加公钥（<a target="_blank" rel="noopener" href="https://gitee.com/help/articles/4181#article-header0">生成/添加SSH公钥</a>）</h4><p>点击管理 —&gt; 部署公钥管理 —&gt; 新增部署公钥，添加公钥的内容也是之前部署到 GitHub 上添加的公钥，具体如下：</p>
<pre class=" language-sh"><code class="language-sh">ssh-keygen -t ed25519 -C "17782975312@163.com"
</code></pre>
<img src="https://notes2021.oss-cn-beijing.aliyuncs.com/2021/image-20220114233218922.png" style="zoom:33%;" />



<img src="https://notes2021.oss-cn-beijing.aliyuncs.com/2021/165455_ec7dbd09_551147.png" style="zoom:33%;" />

<p>添加后，在终端（Terminal）中输入</p>
<pre class=" language-sh"><code class="language-sh">ssh -T git@gitee.com
</code></pre>
<p>首次使用需要确认并添加主机到本机SSH可信列表。若返回 <code>Hi XXX! You&#39;ve successfully authenticated, but Gitee.com does not provide shell access.</code> 内容，则证明添加成功。</p>
<p><img src="https://notes2021.oss-cn-beijing.aliyuncs.com/2021/170837_4c5ef029_551147.png" alt="SSH添加提示"></p>
<p>添加成功后，就可以使用SSH协议对仓库进行操作了。</p>
<p><a target="_blank" rel="noopener" href="https://gitee.com/help/articles/4229#article-header0">Git配置多个SSH-Key</a></p>
<h4 id="部署到码云"><a href="#部署到码云" class="headerlink" title="部署到码云"></a>部署到码云</h4><p>将项目地址复制粘贴到配置文件上，如下图所示：</p>
<p>然后执行 <code>hexo clean &amp;&amp; hexo g -d</code>，部署成功后，点击服务 —&gt;Gitee Pages，进入下面的页面：</p>
<img src="https://notes2021.oss-cn-beijing.aliyuncs.com/2021/image-20220115152500479.png" style="zoom: 50%;" />



<p><img src="https://notes2021.oss-cn-beijing.aliyuncs.com/2021/image-20220116220611346.png"></p>
<p>第一次设置 Gitee Pages 的效果不是我图中所显示的，最后的设置效果就是这样的，当显示图中红色文字已开启 Gitee PAges 服务，网站地址为：<a target="_blank" rel="noopener" href="https://yafine66.gitee.io/">https://yafine66.gitee.io</a> 即部署成功，点击网址，查看效果。</p>
<blockquote>
<p>以后，每次更新进行如下操作即可：</p>
</blockquote>
<ul>
<li><p>本地博客目录下执行<code>hexo clean &amp;&amp; hexo g -d</code>推送到<code>gitee</code>上。</p>
</li>
<li><p>gitee上对应博客仓库的服务下的Gitee Pages服务下点击更新进行重新部署即可。</p>
</li>
</ul>
<p><img src="https://notes2021.oss-cn-beijing.aliyuncs.com/2021/image-20220119133833236.png" alt="image-20220119133833236"></p>
<hr>


<h3 id="部署到Coding-平台（完成中）"><a href="#部署到Coding-平台（完成中）" class="headerlink" title="部署到Coding 平台（完成中）"></a>部署到Coding 平台（完成中）</h3><p>参考：<a target="_blank" rel="noopener" href="https://yafine-blog.cn/posts/51fb.html">https://yafine-blog.cn/posts/51fb.html</a></p>
<hr>







<h3 id="部署到腾讯云（完成中）"><a href="#部署到腾讯云（完成中）" class="headerlink" title="部署到腾讯云（完成中）"></a>部署到腾讯云（完成中）</h3><h4 id="云服务器配置Git"><a href="#云服务器配置Git" class="headerlink" title="云服务器配置Git"></a>云服务器配置Git</h4><p>1.安装依赖库</p>
<pre class=" language-bash"><code class="language-bash">yum <span class="token function">install</span> curl-devel expat-devel gettext-devel openssl-devel zlib-devel 
</code></pre>
<p>2.安装编译工具</p>
<pre class=" language-bash"><code class="language-bash">yum <span class="token function">install</span> gcc perl-ExtUtils-MakeMaker package
</code></pre>
<p>3.查看git的版本y</p>
<pre class=" language-bash"><code class="language-bash"><span class="token function">git</span> version
</code></pre>
<p>4.删除git</p>
<pre class=" language-bash"><code class="language-bash">yum remove <span class="token function">git</span> -y
</code></pre>
<p>5.下载解压最新版</p>
<pre class=" language-bash"><code class="language-bash"><span class="token function">cd</span> /usr/local/src <span class="token comment" spellcheck="true">#下载的目录 wget https://www.kernel.org/pub/software/scm/git/git-2.28.0.tar.gz #下载最新版 tar -zxvf git-2.28.0.tar.gz #解压到当前文件夹</span>
</code></pre>
<p>6.编辑并安装</p>
<pre class=" language-bash"><code class="language-bash"><span class="token function">cd</span> git-2.28.0    <span class="token comment" spellcheck="true">#进入文件夹</span>
<span class="token function">make</span> prefix<span class="token operator">=</span>/usr/local/git all    <span class="token comment" spellcheck="true">#编译源码</span>
<span class="token function">make</span> prefix<span class="token operator">=</span>/usr/local/git <span class="token function">install</span>    <span class="token comment" spellcheck="true">#安装路径</span>
</code></pre>
<p>7.配置git的环境变量</p>
<pre class=" language-bash"><code class="language-bash"><span class="token keyword">echo</span> <span class="token string">'export PATH=<span class="token variable">$PATH</span>:/usr/local/git/bin'</span> <span class="token operator">>></span> /etc/bashrc
</code></pre>
<p>8.刷新环境变量</p>
<pre class=" language-bash"><code class="language-bash"><span class="token function">source</span> /etc/bashrc
</code></pre>
<p>9.查看版本号</p>
<pre class=" language-bash"><code class="language-bash"><span class="token function">git</span> --version
</code></pre>
<p>10.创建git用户并且修改权限</p>
<pre class=" language-bash"><code class="language-bash">adduser admin
<span class="token function">passwd</span> admin
<span class="token function">chmod</span> 740 /etc/sudoers 
vim /etc/sudoers 

root ALL<span class="token operator">=</span><span class="token punctuation">(</span>ALL<span class="token punctuation">)</span> ALL 
fuchen ALL<span class="token operator">=</span><span class="token punctuation">(</span>ALL<span class="token punctuation">)</span> ALL
</code></pre>
<blockquote>
<p>创建git用户并且修改权限遇到的问题<br>Linux修改用户：useradd: cannot open /etc/passwd<br><a target="_blank" rel="noopener" href="https://blog.csdn.net/w5wangdeqing/article/details/90258142">https://blog.csdn.net/w5wangdeqing/article/details/90258142</a></p>
</blockquote>
<p>11.本地mac使用Gitbash创建密钥</p>
<pre class=" language-bash"><code class="language-bash">ssh-keygen -t rsa
</code></pre>
<p>12.将本地创建id_rsa.pub中文件复制</p>
<pre class=" language-bash"><code class="language-bash"><span class="token function">su</span> fuchen
<span class="token function">mkdir</span> ~/.ssh
vim ~/.ssh/authorized_keys
</code></pre>
<p>13.本地测试</p>
<pre class=" language-bash"><code class="language-bash"><span class="token function">ssh</span> -v admin@101.42.229.218
</code></pre>
<h4 id="云服务器网站配置"><a href="#云服务器网站配置" class="headerlink" title="云服务器网站配置"></a>云服务器网站配置</h4><p>1.创建网站目录并且设置权限</p>
<pre class=" language-bash"><code class="language-bash"><span class="token function">su</span> root
<span class="token function">mkdir</span> /home/hexo
<span class="token function">chown</span> admin:admin -R /home/hexo
</code></pre>
<p>2.安装Nginx</p>
<pre class=" language-bash"><code class="language-bash">yum <span class="token function">install</span> -y nginx
systemctl start nginx.service   <span class="token comment" spellcheck="true">#启动服务</span>
</code></pre>
<p>3.修改Nginx配置文件</p>
<pre class=" language-bash"><code class="language-bash">vim /etc/nginx/nginx.conf
</code></pre>
<pre class=" language-bash"><code class="language-bash">    server <span class="token punctuation">{</span>
        listen       80<span class="token punctuation">;</span>
        listen       <span class="token punctuation">[</span>::<span class="token punctuation">]</span>:80<span class="token punctuation">;</span>
        server_name  101.42.229.218<span class="token punctuation">;</span>
        root         /home/hexo<span class="token punctuation">;</span>
</code></pre>
<p>4.重启服务器</p>
<pre class=" language-bash"><code class="language-bash">systemctl restart nginx.service
</code></pre>
<p>5.建立git仓库</p>
<pre class=" language-bash"><code class="language-bash"><span class="token function">su</span> root
<span class="token function">cd</span> /home/admin
<span class="token function">git</span> init --bare blog.git
<span class="token function">chown</span> admin:admin -R blog.git
</code></pre>
<p>6.同步网站根目录</p>
<pre class=" language-bash"><code class="language-bash"><span class="token comment" spellcheck="true"># /home/admin目录下执行下面的命令</span>
vim blog.git/hooks/post-receive

<span class="token comment" spellcheck="true"># 添加如下内容</span>
<span class="token function">git</span> --work-tree<span class="token operator">=</span>/home/hexo --git-dir<span class="token operator">=</span>/home/admin/blog.git checkout -f
</code></pre>
<p>7.修改权限</p>
<pre class=" language-bash"><code class="language-bash"><span class="token function">chmod</span> +x /home/fuchen/blog.git/hooks/post-receive
</code></pre>
<p>8.在windows10本地hexo目录修改_config.yml文件（mac终端）</p>
<pre class=" language-bash"><code class="language-bash">deploy:
  type: <span class="token function">git</span>
  repository: admin@101.42.229.218:/home/admin/blog.git    <span class="token comment" spellcheck="true">#用户名@服务器Ip:git仓库位置</span>
  branch: master
</code></pre>
<p>9.在本机gitbash部署（mac终端）</p>
<pre class=" language-bash"><code class="language-bash"><span class="token comment" spellcheck="true"># 清理下缓存</span>
hexo clean
<span class="token comment" spellcheck="true"># 运行</span>
hexo g -d
</code></pre>
<p>运行时出现如下问题并解决：ERROR Deployer not found: git</p>
<pre class=" language-bash"><code class="language-bash"><span class="token comment" spellcheck="true"># 执行这一句就可以</span>
<span class="token function">npm</span> <span class="token function">install</span> --save hexo-deployer-git
</code></pre>
<blockquote>
<p>感谢下面的博主<br><a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_36401046/article/details/52940313">https://blog.csdn.net/weixin_36401046/article/details/52940313</a></p>
</blockquote>
<h3 id="部署到腾讯云静态托管（已完成）"><a href="#部署到腾讯云静态托管（已完成）" class="headerlink" title="部署到腾讯云静态托管（已完成）"></a>部署到腾讯云静态托管（已完成）</h3><p>部署到腾讯云静态托管，好处：</p>
<ul>
<li>拥有CDN加速，国内和国外访问极速快</li>
<li>相对于服务器，价格更便宜</li>
</ul>
<p>其缺点有：</p>
<ul>
<li>绑定域名，域名需要备案</li>
<li>相对于在GitHub和Gitee上部署，这个方法需要一定开支</li>
</ul>
<p>虽然需要钱，但是开支很低。如果你是图床和博客分离，50篇博文的Hexo博客，不到30M，所以基本只有流量费用。流量费用，流量费是阶梯收费，正常一个月不到5元。</p>
<h4 id="申请静态网站托管"><a href="#申请静态网站托管" class="headerlink" title="申请静态网站托管"></a>申请静态网站托管</h4><p>访问<a target="_blank" rel="noopener" href="https://console.cloud.tencent.com/tcb/hosting/index">腾讯云静态托管</a></p>
<p>获取辅助环境id</p>
<p><img src="https://notes2021.oss-cn-beijing.aliyuncs.com/2021/image-20211231213739115.png" alt="image-20211231213739115"></p>
<p>假设：你的环境id是<code>blogger-000-123456</code></p>
<h4 id="推送本地博客到静态托管"><a href="#推送本地博客到静态托管" class="headerlink" title="推送本地博客到静态托管"></a>推送本地博客到静态托管</h4><p>本地使用</p>
<pre class=" language-bash"><code class="language-bash">hexo g
</code></pre>
<p>在Hexo目录下，生成<code>public</code>文件夹。进入这个文件夹，并执行<code>tcb</code>命令:</p>
<pre class=" language-bash"><code class="language-bash"><span class="token function">cd</span> public
tcb hosting deploy -e blogger-000-123456
</code></pre>
<p>注意替换<code>blogger-000-123456</code>为你自己的环境id。<br>这样，就把本地Hexo文件推送到腾讯云静态托管内。具体腾讯<code>tcb</code>命令使用，可以参考<a target="_blank" rel="noopener" href="https://docs.cloudbase.net/cli-v1/hosting">腾讯云官方文档</a>。</p>
<h4 id="访问静态托管博客"><a href="#访问静态托管博客" class="headerlink" title="访问静态托管博客"></a>访问静态托管博客</h4><p>根据你设置的自定义域名或默认域名即可访问：</p>
<p><img src="https://notes2021.oss-cn-beijing.aliyuncs.com/2021/tcbHexoFinder-20211231220501308.webp" alt="img"></p>
<p>注意：默认域名有访问限制，建议使用自定义域名。</p>
<h2 id="5-写博客"><a href="#5-写博客" class="headerlink" title="5.写博客"></a>5.写博客</h2><p>使用Hexo博客引擎写博客很简单。简单来讲：<code>创建新文章文件</code>-<code>使用Markdown语法编写文件</code>-<code>Hexo博客引擎编译</code>-<code>部署</code>。</p>
<p>建议配合<a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/docs/writing">Hexo官方文档-写作</a>一同查阅配置。</p>
<h3 id="创建新文章文件"><a href="#创建新文章文件" class="headerlink" title="创建新文章文件"></a>创建新文章文件</h3><p>在Hexo目录下</p>
<pre class=" language-bash"><code class="language-bash">hexo new <span class="token string">"New"</span>
</code></pre>
<p>创建了一篇新的博文，博文名为<code>New</code>。</p>
<p>在Hexo目录下的<code>source</code>-<code>_posts</code>文件夹内，就会出现刚刚创建的文章：<code>New.md</code>。</p>
<h3 id="使用Markdown语法编写文件"><a href="#使用Markdown语法编写文件" class="headerlink" title="使用Markdown语法编写文件"></a>使用Markdown语法编写文件</h3><p>Typora</p>
<h3 id="Hexo博客引擎编译"><a href="#Hexo博客引擎编译" class="headerlink" title="Hexo博客引擎编译"></a>Hexo博客引擎编译</h3><p>在写完博文后（<code>.md</code>文件），回到Hexo目录，使用<code>terminal</code>/<code>cmd</code>/<code>powershell</code>输入：</p>
<pre class=" language-bash"><code class="language-bash">hexo g
</code></pre>
<p>即可编译完成，如果有错误，可以再尝试输入：</p>
<pre class=" language-bash"><code class="language-bash">hexo clean
hexo g
</code></pre>
<h3 id="部署"><a href="#部署" class="headerlink" title="部署"></a>部署</h3><pre class=" language-bash"><code class="language-bash"><span class="token comment" spellcheck="true"># 本地</span>
hexo s

<span class="token comment" spellcheck="true"># 腾讯云静态网站托管</span>
hexo g
<span class="token function">cd</span> public
tcb hosting deploy -e blogger-000-123456
</code></pre>
<h3 id="文章多个标签（示例）🏷"><a href="#文章多个标签（示例）🏷" class="headerlink" title="文章多个标签（示例）🏷"></a>文章多个标签（示例）🏷</h3><pre class=" language-yaml"><code class="language-yaml"><span class="token key atrule">tags</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>mac<span class="token punctuation">,</span>npm<span class="token punctuation">]</span>
</code></pre>
<hr>



<h2 id="6-进一步配置"><a href="#6-进一步配置" class="headerlink" title="6.进一步配置"></a>6.进一步配置</h2><h3 id="6-1主题美化（通用）"><a href="#6-1主题美化（通用）" class="headerlink" title="6.1主题美化（通用）"></a>6.1主题美化（通用）</h3><h3 id="6-2hexo主题matery美化"><a href="#6-2hexo主题matery美化" class="headerlink" title="6.2hexo主题matery美化"></a>6.2hexo主题matery美化</h3><blockquote>
<p>以下可以解决90%的问题，强烈建议根据以下3个参考进行主题优化。</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://gitee.com/ryanjiena/hexo-theme-matery">gitee上</a></p>
<p><a target="_blank" rel="noopener" href="https://github.com/blinkfox/hexo-theme-matery/blob/develop/README_CN.md">Github上</a></p>
<p><a target="_blank" rel="noopener" href="https://yafine-blog.cn/posts/4ab2.html">Yafine大佬</a></p>
<blockquote>
<p>主题切换的具体操作</p>
</blockquote>
<p>下载主题到thems目录下，修改 Hexo 根目录下的 <code>_config.yml</code> 的 <code>theme</code> 的值：<code>theme: hexo-theme-matery</code></p>
<pre class=" language-bash"><code class="language-bash"><span class="token function">git</span> clone https://github.com/blinkfox/hexo-theme-matery.git
</code></pre>
<blockquote>
<p>其它参考</p>
</blockquote>
<pre class=" language-bash"><code class="language-bash">https://blog.csdn.net/cungudafa/category_9714183.html

增加樱花🌸飘落效果
https://blog.csdn.net/victoryxa/article/details/105841440?spm<span class="token operator">=</span>1001.2014.3001.5501

https://mintimate.cn/2020/03/19/hexo/<span class="token comment" spellcheck="true">#%E5%89%8D%E6%8F%90</span>
</code></pre>
<h3 id="6-3各种优化"><a href="#6-3各种优化" class="headerlink" title="6.3各种优化"></a>6.3各种优化</h3><p><a target="_blank" rel="noopener" href="https://blog.sky03.cn/posts/42790.html#toc-heading-1">https://blog.sky03.cn/posts/42790.html#toc-heading-1</a></p>
<h4 id="全站CDN加速"><a href="#全站CDN加速" class="headerlink" title="全站CDN加速"></a>全站CDN加速</h4><p>CDN的全称是Content Delivery Network，即内容分发网络。CDN是构建在网络之上的内容分发网络，依靠部署在各地的边缘服务器，通过中心平台的负载均衡、内容分发、调度等功能模块，使用户就近获取所需内容，降低网络拥塞，提高用户访问响应速度和命中率。CDN的关键技术主要有内容存储和分发技术。——百度百科</p>
<p>放在<code>Github</code>的资源在国内加载速度比较慢，因此需要使用CDN加速来优化网站打开速度，<a target="_blank" rel="noopener" href="https://www.jsdelivr.com/">jsDelivr</a> + Github便是免费且好用的CDN，非常适合博客网站使用。</p>
<p>用法：</p>
<pre class=" language-http"><code class="language-http"><span class="token header-name keyword">https:</span>//cdn.jsdelivr.net/gh/你的用户名/你的仓库名@发布的版本号/文件路径
</code></pre>
<p>例如：</p>
<pre class=" language-http"><code class="language-http"><span class="token header-name keyword">https:</span>//cdn.jsdelivr.net/gh/skyls03/skyls03.github.io/medias/loading.gif
</code></pre>
<hr>



<h2 id="7-问题记录"><a href="#7-问题记录" class="headerlink" title="7.问题记录"></a>7.问题记录</h2><h3 id="问题1：hexo博客代码花括号被转义了，显示-amp-123和-amp-123"><a href="#问题1：hexo博客代码花括号被转义了，显示-amp-123和-amp-123" class="headerlink" title="问题1：hexo博客代码花括号被转义了，显示&amp;#123和&amp;#123"></a>问题1：hexo博客代码花括号被转义了，显示<code>&amp;#123</code>和<code>&amp;#123</code></h3><p>根目录下<code>/node_modules/hexo-prism-plugin/src/index.js</code>文件增加如下内容</p>
<p><img src="https://notes2021.oss-cn-beijing.aliyuncs.com/2021/image-20220102002625141.png"></p>
<h3 id="问题2【严重】【犯了多次错误的地方】：🌲路径不存在或没有权限访问："><a href="#问题2【严重】【犯了多次错误的地方】：🌲路径不存在或没有权限访问：" class="headerlink" title="问题2【严重】【犯了多次错误的地方】：🌲路径不存在或没有权限访问："></a>问题2【严重】【犯了多次错误的地方】：🌲路径不存在或没有权限访问：</h3><p><code>/Users/cat/IdeaProjects/blog/.deploy_git/.git/objects/03/bd000d1e90fc73326ff811a426e94f39fec47e</code></p>
<pre class=" language-sh"><code class="language-sh"># 查看文件权限
drwxr-xr-x   18 cat  staff   576B 12 31 17:33 .deploy_git

d  rwx r-x r-x
d代表目录
Linux文件的基本权限有九个，分别是owner/group/others三种身份各有自己的read/write/execute权限。
其中，[ r ]代表可读(read)、[ w ]代表可写(write)、[ x ]代表可执行(execute)。如果没有权限，就会出现减号[ - ]而已。
</code></pre>
<p>解决办法：要在<code>public</code>目录下！！！执行命令，才能部署文件到腾讯云静态网站。否则，报上述错误❎。</p>

                
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="/about" rel="external nofollow noreferrer">Lemonade</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="http://101.42.229.218/2021/12/31/hexo%E6%90%AD%E5%BB%BA%E8%AE%B0%E5%BD%95/">http://101.42.229.218/2021/12/31/hexo%E6%90%AD%E5%BB%BA%E8%AE%B0%E5%BD%95/</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="/about" target="_blank">Lemonade</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/tags/hexo/">
                                    <span class="chip bg-color">hexo</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">
<div id="article-share">

    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>

            
        </div>
    </div>

    

    

    

    

    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/2022/01/01/SpringCloud_2%E9%BB%91%E9%A9%AC/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/10.jpg" class="responsive-img" alt="SpringCloud_2黑马">
                        
                        <span class="card-title">SpringCloud_2黑马</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2022-01-01
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/3-%E5%88%86%E5%B8%83%E5%BC%8F-%E5%BE%AE%E6%9C%8D%E5%8A%A1/" class="post-category">
                                    3.分布式&微服务
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/spring/">
                        <span class="chip bg-color">spring</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/2021/12/31/hello-world/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/12.jpg" class="responsive-img" alt="Hello World">
                        
                        <span class="card-title">Hello World</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2021-12-31
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/5-%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/" class="post-category">
                                    5.环境配置
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>



<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/libs/codeBlock/codeShrink.js"></script>


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget card" style="background-color: white;">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>




    <footer class="page-footer bg-color">
    
        <link rel="stylesheet" href="/libs/aplayer/APlayer.min.css">
<style>
    .aplayer .aplayer-lrc p {
        
        display: none;
        
        font-size: 12px;
        font-weight: 700;
        line-height: 16px !important;
    }

    .aplayer .aplayer-lrc p.aplayer-lrc-current {
        
        display: none;
        
        font-size: 15px;
        color: #42b983;
    }

    
    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body {
        left: -66px !important;
    }

    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body:hover {
        left: 0px !important;
    }

    
</style>
<div class="">
    
    <div class="row">
        <meting-js class="col l8 offset-l2 m10 offset-m1 s12"
                   server="netease"
                   type="playlist"
                   id="7141772781"
                   fixed='true'
                   autoplay='false'
                   theme='#42b983'
                   loop='all'
                   order='list'
                   preload='auto'
                   volume='0.7'
                   list-folded='false'
        >
        </meting-js>
    </div>
</div>

<script src="/libs/aplayer/APlayer.min.js"></script>
<script src="/libs/aplayer/Meting.min.js"></script>

    

    <div class="container row center-align"
         style="margin-bottom: 0px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            
                <span id="year">2019-2022</span>
            
            <a href="/about" target="_blank">Lemonade</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
                &nbsp;<i class="fas fa-chart-area"></i>&nbsp;站点总字数:&nbsp;<span
                        class="white-color">55.6k</span>
            
            
            
                
            
            
                <span id="busuanzi_container_site_pv">
                &nbsp;|&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;
                    <span id="busuanzi_value_site_pv" class="white-color"></span>
            </span>
            
            
                <span id="busuanzi_container_site_uv">
                &nbsp;|&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;
                    <span id="busuanzi_value_site_uv" class="white-color"></span>
            </span>
            
            <br>

            <!-- 运行天数提醒. -->
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/cat0501" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="https://blog.csdn.net/AC_872767407?spm=1001.2014.3001.5343" class="tooltipped" target="_blank" data-tooltip="关注我的CSDN: https://blog.csdn.net/AC_872767407?spm=1001.2014.3001.5343" data-position="top" data-delay="50">
        <i class="fab fa-csdn">C</i>
    </a>



    <a href="mailto:17782975312@163.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=872767407" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 872767407" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







    <a href="/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fas fa-rss"></i>
    </a>

</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script type="text/javascript">
$(function () {
    var searchFunc = function (path, search_id, content_id) {
        'use strict';
        $.ajax({
            url: path,
            dataType: "xml",
            success: function (xmlResponse) {
                // get the contents from search data
                var datas = $("entry", xmlResponse).map(function () {
                    return {
                        title: $("title", this).text(),
                        content: $("content", this).text(),
                        url: $("url", this).text()
                    };
                }).get();
                var $input = document.getElementById(search_id);
                var $resultContent = document.getElementById(content_id);
                $input.addEventListener('input', function () {
                    var str = '<ul class=\"search-result-list\">';
                    var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                    $resultContent.innerHTML = "";
                    if (this.value.trim().length <= 0) {
                        return;
                    }
                    // perform local searching
                    datas.forEach(function (data) {
                        var isMatch = true;
                        var data_title = data.title.trim().toLowerCase();
                        var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
                        var data_url = data.url;
                        data_url = data_url.indexOf('/') === 0 ? data.url : '/' + data_url;
                        var index_title = -1;
                        var index_content = -1;
                        var first_occur = -1;
                        // only match artiles with not empty titles and contents
                        if (data_title !== '' && data_content !== '') {
                            keywords.forEach(function (keyword, i) {
                                index_title = data_title.indexOf(keyword);
                                index_content = data_content.indexOf(keyword);
                                if (index_title < 0 && index_content < 0) {
                                    isMatch = false;
                                } else {
                                    if (index_content < 0) {
                                        index_content = 0;
                                    }
                                    if (i === 0) {
                                        first_occur = index_content;
                                    }
                                }
                            });
                        }
                        // show search results
                        if (isMatch) {
                            str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
                            var content = data.content.trim().replace(/<[^>]+>/g, "");
                            if (first_occur >= 0) {
                                // cut out 100 characters
                                var start = first_occur - 20;
                                var end = first_occur + 80;
                                if (start < 0) {
                                    start = 0;
                                }
                                if (start === 0) {
                                    end = 100;
                                }
                                if (end > content.length) {
                                    end = content.length;
                                }
                                var match_content = content.substr(start, end);
                                // highlight all keywords
                                keywords.forEach(function (keyword) {
                                    var regS = new RegExp(keyword, "gi");
                                    match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
                                });

                                str += "<p class=\"search-result\">" + match_content + "...</p>"
                            }
                            str += "</li>";
                        }
                    });
                    str += "</ul>";
                    $resultContent.innerHTML = str;
                });
            }
        });
    };

    searchFunc('/search.xml', 'searchInput', 'searchResult');
});
</script>

    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/libs/materialize/materialize.min.js"></script>
    <script src="/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/libs/aos/aos.js"></script>
    <script src="/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/js/matery.js"></script>

    

    

    <!-- 雪花特效 -->
    

    <!-- 鼠标星星特效 -->
    

     
        <script src="https://ssl.captcha.qq.com/TCaptcha.js"></script>
        <script src="/libs/others/TencentCaptcha.js"></script>
        <button id="TencentCaptcha" data-appid="xxxxxxxxxx" data-cbfn="callback" type="button" hidden></button>
    

    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/libs/others/busuanzi.pure.mini.js"></script>
    

    

    

    <!--腾讯兔小巢-->
    
    

    
    
    <script type="text/javascript" size="150" alpha='0.6'
        zIndex="-1" src="/libs/background/ribbon-refresh.min.js" async="async"></script>
    

    
    <script type="text/javascript" src="/libs/background/ribbon-dynamic.js" async="async"></script>
    

    
    <script src="/libs/instantpage/instantpage.js" type="module"></script>
    

    
    <script type="text/javascript">
        //只在桌面版网页启用特效
        var windowWidth = $(window).width();
        if (windowWidth > 768) {
            document.write('<script type="text/javascript" src="/js/sakura.js"><\/script>');
        }
    </script>
        

</body>

</html>
